<template>
  <div style="background-color: #f2f2f2;">
    <div style="border: 1px solid #ccc;background-color: #ffffff;height: 100px;margin-bottom: 10px">
      <h2 style="margin-top: 5px;margin-left: 10px;">摄像头管理</h2>
      <div style="display: flex; align-items: center;">
            <h4 style="margin-top:-5px;margin-right: 10px; margin-left: 25px">摄像头名称</h4>
            <el-input v-model="input" placeholder="请输入内容" style="margin-right: 10px; width: 200px;margin-top:-20px;"></el-input>
            <el-button size="small" style="margin-top:-20px;background: linear-gradient(120deg,#64C6D3,#197FBC); color: white;">查询</el-button>
          </div>
    </div>
    <div style="border: 1px solid #ccc; padding: 10px;background-color: #ffffff;">
      <el-button size="small" style="margin-bottom: 5px" @click="dialogFormVisible=true">新增摄像头</el-button>
    <div style="border: 1px solid #ccc; background-color: #ffffff;height: 470px">
        <el-table :data="tableData" style="width: 100%" max-height="480">
          <el-table-column prop="img" label="摄像头">
            <template v-slot="{}">
              <el-image style="width: 25px; height: 25px; border-radius: 50%" :src="require('..\\src\\temp\\test.png')"></el-image>
            </template>
          </el-table-column>
          <el-table-column prop="camera_id" label="序号"></el-table-column>
          <el-table-column prop="camera_id" label="摄像头名称"></el-table-column>
          <el-table-column prop="camera_id" label="所属项目"></el-table-column>
          <el-table-column prop="camera_id" label="类型"></el-table-column>
          <el-table-column prop="camera_id" label="视频项目名称"></el-table-column>
          <el-table-column prop="camera_id" label="新增时间"></el-table-column>
          <el-table-column label="操作" width="230px" align="center">
            <template slot-scope="scope">
              <el-link type="success" style="margin-right: 10px;color: #88DFDA" @click="edit(scope.row)">编辑</el-link>
              <el-popconfirm title="这是一段内容确定删除吗？" @confirm="delList">
                <el-link type="success" slot="reference" style="color: #88DFDA">删除</el-link>
              </el-popconfirm>
            </template>
          </el-table-column>
        </el-table>
    </div>
      <div>
      <hr>
      <div class="block" style="display: flex; justify-content: flex-end;">
        <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400">
        </el-pagination>
      </div>
    </div>
    </div>

    <el-dialog title="摄像头信息" :visible.sync="dialogFormVisible"  width="30%" custom-class="dialog-title-green" >
          <el-form :model="tableFormData">
            <el-form-item label="*摄像头名称:" label-width="25%">
              <el-input v-model="tableFormData.camera_id" autocomplete="off" ></el-input>
            </el-form-item>
            <el-form-item label="*摄像头品牌:" label-width="25%">
              <el-input v-model="tableFormData.camera_name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="*所属厂房:" label-width="25%">
              <el-input v-model="tableFormData.camera_name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="*H5 URL:" label-width="25%">
              <el-input v-model="tableFormData.camera_name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="*HLS URL:" label-width="25%">
              <el-input v-model="tableFormData.camera_name" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="排序:" label-width="25%">
              <el-input v-model="tableFormData.camera_name" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-divider/>
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="editList();" style="background: linear-gradient(120deg,#64C6D3,#197FBC); color: white;">确 定</el-button>
          </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: "AllMonitoring",
  data() {
    return{
      dialogFormVisible: false,
      tableData: [
        {img: "image1.jpg", camera_id: 1, camera_name: 1},{img: "image1.jpg", camera_id: 2},
      ],
      tableFormData: '',
      input:'',
      kobe:''
    }
  },
  mounted() {
    this.getList();
  },
  methods:{
    change(){
      this.$router.push("/realTimeMonitoring");
    },
    edit(obj){
      this.dialogFormVisible=true;
      this.tableFormData=obj;
    },
    //得到数据
    getList(){

    },
    //添加修改数据
    editList(){
      if(this.kobe.trim() === ''){
        alert("摄像头编号不能为空!");
      }
      else {
        this.dialogFormVisible = false;
      }
    },
    //删除数据
    delList(){

    },
  }
}
</script>

<style>
.dialog-title-green .el-dialog {
  border-radius: 10px;
}
.el-table th {
  background-color: #EDF8F9; /* 设置表格标签行的背景颜色为绿色 */
  color: black;
}
.dialog-title-green .el-dialog__header {
  background-color: #E8F8F9;
  color: black;
  font-weight: bold; /* 设置标题行文字加粗 */
}

</style>
